<?
$data = implode("", file("example.xml"));
echo "<PRE>";
require_once 'classes.php';
require_once('../../../resource/classes/domit/xml_domit_include.php');
$cdCollection =& new DOMIT_Document();
$success = $cdCollection->loadXML("example.xml");
if ($success) {
  //gets a reference to the root element of the cd collection
  $myDocumentElement =& $cdCollection->documentElement;
}else {
  //an error has occurred; echo to browser
  echo "Error code: " . $cdCollection->getErrorCode();
  echo "\n<br />";
  echo "Error string: " . $cdCollection->getErrorString();
}
$myFile =  $myDocumentElement->toArray(true);
$cr="<BR>";

echo "<u>Project Summary</U>$cr";

echo "PROJECT NAME:".$myFile["project"]["attributes"]["name"]."<BR>";
echo "PROJECT VERSION:".$myFile["project"]["attributes"]["version"]."<BR>";
$config = $myFile["project"][1]["config"];
$pDesc = $myFile["project"][0]["description"][0];
$modules = $myFile["project"][2]["modules"];

echo "CONFIG:".(is_array($config)?"YES":"NO")."$cr";
$currentConfig = new config($config);
$currentModules = new modules($modules);

$tp = trim($currentConfig->mysql_table_prefix)."";

echo "CREATE: PHP Classes [".($currentConfig->php_classes?"X":" ");
echo "] MySQL [".($currentConfig->mysql_tables?"X":" ");
echo "] CMS [".($currentConfig->php_admin?"X":" ")."] $cr";
echo "<HR><u>MODULES</u>:".(count($modules)-1)."$cr";

foreach($currentModules->mods as $mod){
//	echo "&nbsp;&nbsp;Module Name:".$mod->name."$cr";
	
	$className="".$mod->name;
	$projName = $myFile["project"]["attributes"]["name"];
	$projVersion = $myFile["project"]["attributes"]["version"];
	$projLink = $myFile["project"]["attributes"]["link"];
	$projCompany = $myFile["project"]["attributes"]["company"];
	$projAuthor = str_replace('}','>',str_replace('{','<',$myFile["project"]["attributes"]["author"]));
	$modDescAr = explode("\n",trim(ereg_replace("\t","",$mod->description)));
	$modDesc ="";
	foreach($modDescAr as $md){
		$modDesc .="".$md."\n* ";
	}
	$pd = explode("\n",trim(ereg_replace("\t","",$pDesc)));
	$ppd="";
	foreach($pd as $nd){
		$ppd .="".$nd."\n* ";
	}
	$modName=strtoupper($mod->name);
	if ($currentConfig->mysql_tables)
		include("mysql_table.php");
	if ($currentConfig->php_classes)
		include("php.class.php");

}
echo "</PRE>";



?>
